-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed displayError
being incorrectly used for all tests attempts
#530
Conversation
🦋 Changeset detectedLatest commit: cc5e1ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@cypress/[email protected], npm/[email protected] |
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is an install script?Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts. Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
@@ -54,6 +54,6 @@ | |||
"ws": "^8.14.2" | |||
}, | |||
"peerDependencies": { | |||
"cypress": ">=5.3.0" | |||
"cypress": "^13" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cypress 13 was released almost one year ago (08/29/2023). We don't have any tests for this whole integration, trying to test compatibility manually with an extended range of versions is a nightmare. I don't feel we can quite guarantee compatibility right now with other versions, it's impractical.
If requested by clients we can always loosen up this range after manually confirming that a particular combination works. We'll release a new major of this package soon so I think we should grab the opportunity and bump this here.
Note that supporting more right now would require some extra work here, I changed this because I ran into typing problems (that likely were related to breaking changes in Cypress).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support this.
// Cypress 10.9 types are wrong here ... duration doesn't exist but wallClockDuration does | ||
approximateDuration: a.duration || (a as any).wallClockDuration || 0, | ||
// those properties don't exist since Cypress 13: https://github.com/cypress-io/cypress/pull/27230 | ||
approximateDuration: (a as any).duration || (a as any).wallClockDuration || 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the latest version of Cypress this is non-sensical. It will just always be 0. I'm afraid to remove it though, without confirming that devtools and dashboard would be fine without this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a Linear task + TODO comment to follow up here? Else it will get forgotten about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, PRO-640
// `.displayError` represents the error reported by the last attempt | ||
// for all of the previous attempts we rely on the search for the last errored step in `groupStepsByTest` | ||
// if an error is found there, it will be set on the test, the information set here is not overriden though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is a little bit wonky but it makes sense. The .displayError
is something computed by Cypress so it should have higher accuracy than what we can compute on our own. OTOH, we have to compute this on our own for non-last attempts because Cypress doesn't expose this information to us.
It would be great to refactor this so we don't have to rely on a mutation elsewhere but that's out of this PR's scope
@@ -579,7 +579,7 @@ function register() { | |||
logs: () => [], | |||
add: () => {}, | |||
get: (key?: any) => (!key ? log : log[key]), | |||
toJSON: () => log, | |||
toJSON: () => [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the previous version was completely crashing Cypress, the toJSON
's type here expects string[]
so I used an empty array to ensure that it's compatible. In Cypress 10 log
was typed as any
and maybe at that time it worked OK, dunno. Today it's an object so we can see how it isn't compatible with the expected string[]
.
I verified that we can still render cy.log
just fine with this. It's quite plausible that we just don't rely on the return value of this function.
f866693
to
14d64ba
Compare
This PR addresses one of the issues recognized in https://linear.app/replay/issue/PRO-597